package com.spzx.order.receiver;

import com.spzx.common.rabbit.constant.MqConst;
import io.lettuce.core.dynamic.annotation.Key;
import lombok.extern.slf4j.Slf4j;
import org.springframework.amqp.core.Message;
import org.springframework.amqp.rabbit.annotation.Exchange;
import org.springframework.amqp.rabbit.annotation.Queue;
import org.springframework.amqp.rabbit.annotation.QueueBinding;
import org.springframework.amqp.rabbit.annotation.RabbitListener;
import org.springframework.stereotype.Component;

@Slf4j
@Component
public class TestReceiver {




    @RabbitListener(bindings = @QueueBinding(
            exchange = @Exchange(value = MqConst.EXCHANGE_TEST),
            value=@Queue(value = MqConst.QUEUE_TEST),
            key = MqConst.ROUTING_TEST
    ))
    public void test(String content, Message message){
        log.info(message.toString());
        log.info(content);
    }
}
